<!--  -->
<template>
  <div>
    <ul class="mui-table-view">
      <li class="mui-table-view-cell mui-media" v-for="itme in newslist" :key="itme.total">
        <router-link :to="'/home/newsinfo/' + itme.id">
          <img
            class="mui-media-object mui-pull-left"
            :src="itme.img_url"
          />
          <div class="mui-media-body">
            <h1>{{ itme.title }}</h1>
            <span class="contents">内容简介:{{ itme.summary }}</span>
            <p class="mui-ellipsis">
              <span>发表时间:{{ itme.create_time }}</span>
              <span>点击：{{ itme.clicked }}</span>
            </p>
          </div>
        </router-link>
      </li>
    </ul>
  </div>
</template>

<script>
import { Toast } from "mint-ui";
export default {
  data() {
    return {
        newslist:[]
    };
  },
  created() {
    this.getNewsList()
  },
  methods: {
    getNewsList() {
      this.axios.get("/v2/news_lst").then(res => {          
        if (res.data.code == 1) {
          this.newslist = res.data.data
        //   console.log(this.newslist);
          
        } else {
          Toast("失败");
        }
      });
    }
  }
};
</script>
<style lang='scss' scoped>
.mui-media-body {
  h1 {
    font-size: 1rem;
  }
  .contents{
      color: #383838;
      font-size: 0.85rem;
  }
  .mui-ellipsis {
    color: #8e8e8e;
    display: flex;
    justify-content: space-between;
  }
}
</style>